function [finalC, finalPayoff] = calcIntervalSG(gameModel, m)
       targets=gameModel.targets;
       Uud    =gameModel.defenderUncoveredPayoffs;
       Ucd    =gameModel.defenderCoveredPayoffs;
       Uua    =gameModel.attackerUncoveredPayoffs;
       Uca    =gameModel.attackerCoveredPayoffs;
       C      =gameModel.coverageVector;
       finalPayoff=0;
       e=0.05;
       Tsize=length(targets);
       maxPayoff=0;
       minPayoff=Interval.minValue(Uud);
       while (maxPayoff-minPayoff)>e 
           midPoint=maxPayoff+(minPayoff-maxPayoff)/2;
           [ret,C]=feasibilityCheck(midPoint,m,C);
           if strcmp(ret,'true')
               minPayoff=midPoint;
               finalPayoff=midPoint;
               finalC=C;
           else
               maxPayoff=midPoint; 
           end
       end
       
       
       
       function [ret,C]=feasibilityCheck(midPoint,m,C)
        Tsize=length(C);
        e=0.05;
        for t=1:Tsize
          c1(t)= get_c1(t);
        end
        for t=1:Tsize
            totalCov=c1(t);
            C(t)=c1(t);
            if C(t)>1
              continue  
            end
            R=get_R(c1(t),t);
            for tj=1:Tsize
                if(t==tj)
                    continue
                end
                c2=get_c2(R,tj);
                minCov=minI(c1(tj),c2);
                if minCov<0 || minCov>1
                    break
                end
                totalCov=totalCov+minCov;
                C(tj)=minCov;
            end
            if (minCov>=0 && minCov<=1) && totalCov<=m
                ret='true';
                return 
             end
        end
        ret='false';
        return 
        
        function c1=get_c1(t)
                %cash=1-(midPoint-Uud(t))/(Ucd(t)-Uud(t));
                cash=(midPoint-Uud(t))/(Ucd(t)-Uud(t));
                c1=max(cash,0);        
            end
            function c2=get_c2(R,t)
                upBound=max(Uua(t),Uca(t));
                lowBound=min(Uua(t),Uca(t));
                if R<lowBound 
                    c2=2;
                    return;
                end

                if R>upBound 
                    c2=0;
                    return;
                end
                cash=(R-Uua(t))/(Uca(t)-Uua(t));
                c2=maxI(cash,0); 
            end
            function R=get_R(c1,t)
                R=(c1*Uca(t))+((1-c1)*Uua(t)-e);
            end
        end
    end
